﻿@model EM.OA.Portal.Models.AnnouncementModels

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_LayoutContent.cshtml";
}
<script type="text/javascript" src="~/Scripts/page/DailyWork/Announcement.js"></script>
<script type="text/javascript">
    //初始化树
    $(function () {
        $('#tt').tree({
            url: '/Dictionary/GetDictionaryListByCode?kind=AnnounceKind',
            loadFilter: function (rows) {
                return convert(rows);
            },
            onClick: function (node) {
                init(node.id);
            }
        });
    });
</script>
<div class="easyui-layout" style="height: 500px;">
    @*tree*@
    <div data-options="region:'west',split:true" title="公告类型" style="width: 150px;">
        <ul class="easyui-tree" id="tt"></ul>
    </div>
    @*list*@
    <div data-options="region:'center',title:'公告列表'">
        <table id="list" class="easyui-datagrid"></table>
    </div>
    @*detail*@
    <div data-options="region:'east',title:'',split:true" style="width: 500px;">
        <div id="toolbar" style="float: right;">
            <a href="#" class="easyui-linkbutton" iconcls="icon-add" plain="true" onclick="add()">发布</a>
            <a href="#" class="easyui-linkbutton" iconcls="icon-edit" plain="true" onclick="edit()">修改</a>
            <a href="#" class="easyui-linkbutton" iconcls="icon-remove" plain="true" onclick="del()">删除</a>
        </div>
        <div style="margin: 30px 0px 0px 10px;">
            <div id="announcentTitle"></div>
            <div style="height: 10px;"></div>
            <div id="announcentContent"></div>
        </div>
    </div>
</div>

@*edit*@
<div id="dlg" class="easyui-dialog" style="width: 600px; height: 420px; padding: 10px 20px"
    closed="true" buttons="#dlg-buttons" modal="true" resiz>
    <form id="fm" method="post">
        @Html.HiddenFor(m => m.AnnouncementID)
        <table>
            <tr>
                <td style="text-align: right;">@Html.LabelFor(m => m.Kind)：</td>
                <td>@Html.DropDownListFor(m => m.Kind, new EM.OA.WebCommon.Base.BaseViewModel().GetListItems("AnnounceKind"), new { @class = "easyui-combobox", @required = "true" })
                </td>
            </tr>
            <tr>
                <td style="text-align: right;">@Html.LabelFor(m => m.Title)：</td>
                <td>@Html.TextBoxFor(m => m.Title, new { @class = "easyui-validatebox", @required = "true" })</td>
            </tr>
            <tr>
                <td style="text-align: right;">@Html.LabelFor(m => m.Content)：</td>
                <td>@Html.TextAreaFor(m => m.Content, new { @style = "width:100%", @cols = "50", @rows = "10", @class = "easyui-validatebox", @required = "true" }) </td>
            </tr>
            <tr>
                <td style="text-align: right;">@Html.Label("附件")：</td>
                <td>
                    <a href="#">附件上传</a>
                    <span style="color: #808080">单次上传文件大小不能超过20M。</span>
                </td>
            </tr>
            <tr>
                <td style="text-align: right;">@Html.CheckBoxFor(m => m.IsWebMessage)</td>
                <td>@Html.LabelFor(m => m.IsWebMessage)</td>
            </tr>
            <tr>
                <td style="text-align: right;">@Html.CheckBoxFor(m => m.IsSMS)</td>
                <td>@Html.LabelFor(m => m.IsSMS)</td>
            </tr>
            <tr>
                <td style="text-align: right;">@Html.CheckBoxFor(m => m.IsEmail)</td>
                <td>@Html.LabelFor(m => m.IsEmail)</td>
            </tr>
        </table>
    </form>
</div>
<div id="dlg-buttons">
    <a href="#" class="easyui-linkbutton" iconcls="icon-ok" onclick="save()">保存</a>
    <a href="#" class="easyui-linkbutton" iconcls="icon-cancel" onclick="javascript:$('#dlg').dialog('close')">取消</a>
</div>
